<html>
<head><meta charset="utf-8"><title>Emacs: directory watch goes one level up? · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Emacs.3A.20directory.20watch.20goes.20one.20level.20up.3F.html">Emacs: directory watch goes one level up?</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="206029453"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Emacs%3A%20directory%20watch%20goes%20one%20level%20up%3F/near/206029453" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> apiraino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Emacs.3A.20directory.20watch.20goes.20one.20level.20up.3F.html#206029453">(Aug 05 2020 at 14:36)</a>:</h4>
<p>Hi, I don't understand the behaviour of <code>lsp-rust</code> when scanning directories for watch. Seems that sometimes it suggests watching one level up to the current directory. In the following cast I am in <code>~/tmp/test-ra</code> and it suggest watching ~/tmp`.</p>



<a name="206029481"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Emacs%3A%20directory%20watch%20goes%20one%20level%20up%3F/near/206029481" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> apiraino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Emacs.3A.20directory.20watch.20goes.20one.20level.20up.3F.html#206029481">(Aug 05 2020 at 14:36)</a>:</h4>
<p><a href="/user_uploads/4715/aWjvcOjlc8LpajVY1N5RM0Al/demo-ra.gif">demo-ra.gif</a></p>
<div class="message_inline_image"><a href="/user_uploads/4715/aWjvcOjlc8LpajVY1N5RM0Al/demo-ra.gif" title="demo-ra.gif"><img src="/user_uploads/4715/aWjvcOjlc8LpajVY1N5RM0Al/demo-ra.gif"></a></div>



<a name="206029540"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Emacs%3A%20directory%20watch%20goes%20one%20level%20up%3F/near/206029540" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> apiraino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Emacs.3A.20directory.20watch.20goes.20one.20level.20up.3F.html#206029540">(Aug 05 2020 at 14:37)</a>:</h4>
<p>I've tried looking at the Lisp code but couldn't figure out the behaviour <span aria-label="thinking" class="emoji emoji-1f914" role="img" title="thinking">:thinking:</span></p>



<a name="206029811"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Emacs%3A%20directory%20watch%20goes%20one%20level%20up%3F/near/206029811" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Emacs.3A.20directory.20watch.20goes.20one.20level.20up.3F.html#206029811">(Aug 05 2020 at 14:39)</a>:</h4>
<p>lsp-mode uses projectile to determine the project root, and should then ask you on first open whether you want to use the proposed directory or choose another</p>



<a name="206029880"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Emacs%3A%20directory%20watch%20goes%20one%20level%20up%3F/near/206029880" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Emacs.3A.20directory.20watch.20goes.20one.20level.20up.3F.html#206029880">(Aug 05 2020 at 14:39)</a>:</h4>
<p>to get it to ask again for everything, you could delete <code>~/.emacs.d/.lsp-session-v1</code>, I think</p>



<a name="206029997"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Emacs%3A%20directory%20watch%20goes%20one%20level%20up%3F/near/206029997" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Emacs.3A.20directory.20watch.20goes.20one.20level.20up.3F.html#206029997">(Aug 05 2020 at 14:40)</a>:</h4>
<p>but for further information, you should ask in the emacs-lsp repository, there isn't really anything specific to rust-analyzer or even rust here as far as I know</p>



<a name="206030155"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Emacs%3A%20directory%20watch%20goes%20one%20level%20up%3F/near/206030155" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Emacs.3A.20directory.20watch.20goes.20one.20level.20up.3F.html#206030155">(Aug 05 2020 at 14:41)</a>:</h4>
<p>my guess is that you initialized a session in <code>~/tmp</code> at some point though, so now it just uses that for any subfolder of that directory</p>



<a name="206030236"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Emacs%3A%20directory%20watch%20goes%20one%20level%20up%3F/near/206030236" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> apiraino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Emacs.3A.20directory.20watch.20goes.20one.20level.20up.3F.html#206030236">(Aug 05 2020 at 14:42)</a>:</h4>
<p><span class="user-mention silent" data-user-id="129457">Florian Diebold</span> <a href="#narrow/stream/185405-t-compiler.2Fwg-rls-2.2E0/topic/Emacs.3A.20directory.20watch.20goes.20one.20level.20up.3F/near/206030155">said</a>:</p>
<blockquote>
<p>my guess is that you initialized a session in <code>~/tmp</code> at some point though, so now it just uses that for any subfolder of that directory</p>
</blockquote>
<p>definitively. I didn't know that file existed, discovered a lot of junk there :-) that I will delete</p>



<a name="206030311"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Emacs%3A%20directory%20watch%20goes%20one%20level%20up%3F/near/206030311" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> apiraino <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Emacs.3A.20directory.20watch.20goes.20one.20level.20up.3F.html#206030311">(Aug 05 2020 at 14:42)</a>:</h4>
<p>thank you so much for the hint and sorry for the out-of-scope question: sometimes I fail to figure out which Emacs component does what :-/</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>